home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
amac44d.zip
/
SIZE19.QM
< prev
next >
Wrap
Text File
|
1992-04-26
|
14KB
|
241 lines
* SIZE19.QM
* Macros To Show Byte Size of Macros
* Written by Tom Hogshead
* With Macro Contributions by Fred Drake
* 4/23/92
*-- BYTES
* @(3) Size of SINGLE Macro In Short Format: 223 |NEW
*
* 223 bytes 4/22/92 11:38 pm (TH @3)
*
*--
* @(1) Size of SINGLE Macro In Format: 146 |chg
*
* 146 bytes Wed 04-22-1992 23:31:51 (TH @1)
*
*--
* @(2)Size of ALL Macros In File In Format: 147 |chg
*
* 147 bytes Wed 04-22-1992 23:34:18 (TH @2)
*
*--eoi
* DESCRIPTION: SIZE19.QM macros insert a macro's byte size at end of macro.
* NOTES: a) QEdit and QMAC v2.15 are required.
* b) Remove "SetScreenOff" if not using QEdit v2.15.
* c) Volume label must not contain ASCII #237 "φ".
* d) Temporary files "c:#", "c:#.φ" and "c:¡" are created/deleted.
* e) Change c:\ to a ramdisk for faster operation. Mine is c:\.
* f) Macros have been tested only with DOS 3.3. Others should be Ok.
* g) Macro must be a paragraph with NO blank lines.
* h) QSIZ.BAT and QMAC.EXE must be in path.
* i) Word "macro_begin" (no _) must be used only at start of macro.
* j) Key and "macro_begin" must be on same line.
* k) I am not affiliated with SemWare.
* ┌─── This QSIZ.BAT batch file must be in the path ───┐
* │@echo off │
* │:qsiz.bat October 17, 1991 │
* │ cls │
* │ echo Converts "c:#" (text) to "c:#.φ" (binary)│
* │ if not exist c:# goto NOTEXIST │
* │ QMAC c:#.φ c:# /B /A- │
* │ dir c:#.φ>c:¡ │
* │ del c:# │
* │ del c:#.φ │
* │ exit │
* │:NOTEXIST │
* │ echo c:# does not exist │<-last char ^P^G
* └──────────────────────────────────────────────────────┘
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Macro to Show Byte Size of SINGLE Macro
* Written by Tom Hogshead and Fred Drake
* ----------------------------------------------------------------------
* This macro inserts macro byte size of a SINGLE macro at the end of
* the macro as shown below. Place cursor line anywhere in a txtfile
* macro and press @1.
@1 macrobegin setscreenoff onewindow endline
setwordwrapmode togglewordwrap *|
find "macro" "begin" return "BI" return * Find start of macro
jfalse END * End if no macro
splitline endline unmarkblock markcharacter * Mark key *|
prevposition joinline begline * " " *|
storescrbuff "7" return * Store <key> to buff 7
endpara markline * Mark macro *|
writeblock "c:#" return * Write macro block to c:# *|
"o" backspace * In case c:# exists *|
dos "qsiz" return return * Make macfile Dir list c:¡
editfile backspace #173 return quit * Quit c:¡
gotoblockend * Ensure correct ring pos
editfile return * Load macfile Dir list
find #237 return delline return jfalse END * Pos cursor on macfile ext
wordright markword * Mark size
storescrbuff "8" return * Store size to buff 8
killfile quit * Kill/quit c:¡ *|
addline begline * Add size line to macro *|
"*" cursorright getscrbuff "8" return * Insert byte size
endline cursorright "bytes"
cursorright insertdate inserttime * Date stamp
"(TH " * Change to your initials
getscrbuff "7" return gotoblockend * Insert key
endline jtrue END * Test if Enter Matching On
")" cursorleft *ELSE Insert ")" if not On
END: togglewordwrap unmarkblock *|
*
* 189 bytes Thu 09-13-1990 19:13:24
* 199 bytes Thu 05-16-1991 11:32:44 (TH added author ID)
* 209 bytes Mon 07-01-1991 15:01:30 (TH @1, added macro <key>)
* 202 bytes Thu 10-03-1991 22:55:03 (TH @1, shortened, #3/708)
* 204 bytes Sat 10-05-1991 19:12:57 (TH @1, for all DOS versions, #3/711)
* 180 bytes Mon 10-07-1991 10:28:03 (TH @1, shortened, #3/714)
* 181 bytes Fri 10-11-1991 22:47:10 (FD @1, #3/719)
* 160 bytes Sat 10-12-1991 10:03:27 (TH @1, mod to FD #3/719 ver, #3/721)
* 154 bytes Sat 10-12-1991 13:41:13 (TH @1, changed to qsiz.bat, #3/722)
* 142 bytes Mon 10-14-1991 00:52:50 (FD @1, #3/723)
* 149 bytes Tue 10-15-1991 11:58:48 (TH @1, EnterMatching/Insert On or Off)
* 143 bytes Thu 10-17-1991 10:23:30 (TH @1, changed "c:#.mac" to "c:#.φ"
* 143 bytes Wed 04-15-1992 13:32:13 (TH @1, changed for keys like @[)
* 143 bytes Wed 04-15-1992 13:32:13 (TH @1, to ALL, #3/837)
* 143 bytes Wed 04-15-1992 13:32:13 (TH @1, to NS, #20/566 4/16)
* 146 bytes Wed 04-22-1992 23:31:51 (TH @1, toggle word wrap off)
*
* ----------------------------------------------------------------------
* @(2) Macro To Show Byte Size of ALL Macros in File
* ----------------------------------------------------------------------
* This macro inserts macro byte size of ALL macros in a file at the
* end of each macro as shown below.
@2 macrobegin setscreenoff onewindow begfile
setwordwrapmode togglewordwrap *|
NEXT:
find "macro" "begin" return "I" return * Find start of macro
jfalse END * End if no macro
splitline endline unmarkblock markcharacter * Mark key *|
prevposition joinline begline * " " *|
storescrbuff "7" return * Store <key> to buff 7
endpara markline * Mark macro *|
writeblock "c:#" return * Write macro block to c:# *|
"o" backspace * In case c:# exists *|
dos "qsiz" return return * Make macfile Dir list c:¡
editfile backspace #173 return quit * Quit c:¡
gotoblockend * Ensure correct ring pos
editfile return * Load macfile Dir list
find #237 return delline return jfalse END * Pos cursor on macfile ext
wordright markword * Mark size
storescrbuff "8" return * Store size to buff 8
killfile quit * Kill/quit c:¡ *|
addline begline * Add size line to macro *|
"*" cursorright getscrbuff "8" return * Insert byte size
endline cursorright "bytes"
cursorright insertdate inserttime * Date stamp
"(TH " * Change to your initials
getscrbuff "7" return gotoblockend * Insert key
endline jtrue END * Test if Enter Matching On
")" cursorleft *ELSE Insert ")" if not On
jump NEXT * Loop until no more macros
END: togglewordwrap unmarkblock *|
*
* 200 bytes Thu 09-13-1990 19:13:19
* 176 bytes Mon 10-07-1991 10:50:13 (TH @2, for all DOS versions, #3/714)
* 150 bytes Tue 10-15-1991 11:59:41 (TH @2, EnterMatching/Insert On or Off)
* 144 bytes Thu 10-17-1991 11:23:01 (TH @2, changed "c:#.mac" to "c:#.φ"
* 144 bytes Wed 04-15-1992 13:49:32 (TH @2, changed for keys like @[)
* 147 bytes Wed 04-22-1992 23:34:18 (TH @2, toggle word wrap off)
*
* ----------------------------------------------------------------------
* @(3) Macro to Show Byte Size of SINGLE Macro In Short Format:
* * 223 bytes 4/22/92 11:38 pm (TH @3)
* ----------------------------------------------------------------------
* This macro inserts macro byte size of a SINGLE macro at the end of
* the macro as shown below in a shorter format than @1, as shown
* above. Place cursor line anywhere in a txtfile macro and press @3.
* The data file $time must exist in the current directory. Change
* $time to d:\path\$time to execute in any directory.
* ┌─────────────────────────────────────────────────────────────────────┐
* │$time │
* │01 1 am 02 2 am 03 3 am 04 4 am 05 5 am 06 6 am 07 7 am 08 8 am│
* │09 9 am 10 10 am 11 11 am 12 12 pm 13 1 pm 14 2 pm 15 3 pm 16 4 pm│
* │17 5 pm 18 6 pm 19 7 pm 20 8 pm 21 9 pm 22 10 pm 23 11 pm 00 12 am│
* └─────────────────────────────────────────────────────────────────────┘
@3 macrobegin setscreenoff onewindow endline
setwordwrapmode togglewordwrap *|
* ------------ Get Macro Key and Size To Scratch Buffers ------------*
find "macro" "begin" return "BI" return * Find start of macro
jfalse END * End if no macro
splitline endline unmarkblock markcharacter * Mark key
prevposition joinline begline * " "
storescrbuff "7" return * Store <key> to buff 7
endpara markline * Mark macro
writeblock "c:#" return * Write macro block to c:#
"o" backspace * In case c:# exists
dos "qsiz" return return * Make macfile Dir list c:¡
editfile backspace #173 return quit * Quit c:¡
gotoblockend * Ensure correct ring pos
editfile return * Load macfile Dir list
find #237 return delline return jfalse END * Pos cursor on macfile ext
wordright markword * Mark size
storescrbuff "8" return * Store size to buff 8
killfile quit * Kill/quit c:¡
* ---------------------- Insert Macro Byte Size ----------------------*
addline begline * Add size line to macro
"*" cursorright getscrbuff "8" return * Insert byte size
endline cursorright "bytes" cursorright
* ------------------- Insertdate in format 4/15/92 -------------------*
cursorright defaultwordset
insertdate prevposition delrtword * Del day name
unmarkblock markcolumn
findreplace "0" return delline return "ln" return * Remove leading zeros
wordright repeatfind
backspace "/" wordright backspace "/" * Delete dashes
delch delch * Delete "19"
markword gotoblockend cursorright * Pos 2 spcs right
* ------------------- Insert Time in format 2:19 pm ------------------*
cursorright splitline
inserttime delltword delltword delltword * Delete ":secs "
wordleft wordleft markword cut * Cut 24 hour # to scrap
onewindow horizontalwindow * Setup window for $time
editfile "$time" return * Load data file
find paste return delline return * Find 24 hour #
wordright markcolumn wordright cursorright * Mark 12 hour and am/pm
copy quit prevwindow onewindow paste * Copy/quit/paste data
wordright markword cursorleft markcolumn * Mark " am/pm"
endline moveblock * Move it where it belongs
endline cursorright joinline * Clean up and pos cursor
* ------------------ Insert Author Initials and Key ------------------*
"(TH " * Change to your initials
getscrbuff "7" return gotoblockend * Insert key
endline jtrue END * Test if Enter Matching On
")" cursorleft *ELSE Insert ")" if not On
END: togglewordwrap unmarkblock *|
*
* 220 bytes 4/15/92 2:17 pm (TH @3, to ALL, #3/837)
* 223 bytes 4/22/92 11:38 pm (TH @3, toggle word wrap off)
* VERSION HISTORY
* 1.8 - Macros did not work correctly if windows were open or 10/9/91
* if temp files existed prior to execution. Corrected.
* - QEdit v2.15 required. 10/10/91
* - Implemented changes suggested by Fred Drake. 10/12/91
* Changed batch file name from qmacb.bat to qsiz.bat.
* - Modified for EnterMatching/Insert On or Off. 10/15/91
* - Changed qsiz.bat. 10/17/91
* - In AMAC42.ZIP. 3/28/92
* 1.9 - Changed @1/2 for keys like @[. 4/15/92
* - Added @3. 4/15/92
* - Modified @1/2/3 to toggle Word Wrap OFF. 4/22/92
*
*
*
*
*
*--eof